        <?php
			if($mainBranchExist==TRUE || $isBranchOwner==TRUE)
			{
				header('location:'.base_url().'dashboard/restaurants');
			}
		?>
        <div class="dashboardWrapper">
            <header>
            	<table>
                	<tbody>
                    	<tr>
                        	<td class="logo">SUMMON</td>
                        	<td class="menu">
                            	<ul>
                                	<li>
                                    	<ul>
                                        	<li><a href="<?=base_url()?>dashboard/messages"><i class="icon-envelope"></i> Messages<span class="newMsgCount"></span></a></li>
                                        	<li><a href="<?=base_url()?>dashboard/restaurants"><i class="icon-glass"></i> Restaurants</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </td>
                        	<td class="user">
                                <div class="menuToggleBtn">
                                	<button class="btn" id="toggleMenu">
                                		<i class="icon-align-justify"></i>
                                    </button>
                                </div>
                                <div class="navbar navbar-static">
                                    <ul class="nav" role="navigation">
                                        <li class="dropdown">
                                            <ul class="nav pull-right">
                                                <li id="fat-menu" class="btn-group dropdown">
                                                    <button class="btn dropdown-toggle leftBtn" data-toggle="dropdown" role="button">
                                                        <span class="nameShow">
                                                        <?php
                                                            if($fullname!='')
                                                            {
                                                                echo '<i class="icon-user"></i> '.$fullname;
                                                            }
                                                            else
                                                            {
                                                                echo 'Guest!';	
                                                            }
                                                        ?>
                                                        </span>
                                                        <span class="nameHide">
                                                            <i class="icon-user"></i>
                                                        </span>

                                                    </button>
                                                    <button class="btn dropdown-toggle" data-toggle="dropdown">
                                                        <i class="icon-cog"></i>
                                                    </button>
                                                    <ul class="dropdown-menu" aria-labelledby="drop3" role="menu">
                                                        <li role="presentation">
                                                        	<span class="hiddenName"><?=$fullname?></span>
                                                            <p><?=$userType?></p>
                                                        </li>
                                                        <li role="presentation">
                                                            <a href="<?=base_url()?>dashboard/account_settings/<?=$myID?>" tabindex="-1" role="menuitem"><i class="icon-edit"></i> Account Settings</a>
                                                        </li>
                                                        <li class="divider" role="presentation"></li>
                                                        <li role="presentation">
                                                            <a href="<?=base_url()?>dashboard/logout" tabindex="-1" role="menuitem"><i class="icon-off"></i> Log Out</a>
                                                        </li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </header>
            <section>
                <div class="container-fluid">
                    <div class="row-fluid">
                        <div class="span2 leftWrapper" id="menuToToggle">
                        	<h2><i class="icon-tasks"></i> Menu</h2>
                        	<div class="hiddenMenu">
                            	<ul>
                                	<li>
                                    	<ul>
                                        	<li><a href="<?=base_url()?>dashboard/messages"><i class="icon-envelope"></i> Messages<span class="newMsgCount"></span></a></li>
                                        	<li><a href="<?=base_url()?>dashboard/restaurants"><i class="icon-glass"></i> Restaurants</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                            <div class="defaultMenu">
                            	<ul>
                                	<li>
                                    	<ul>
                                            <li><a href="<?=base_url()?>dashboard/reserved_lists"><i class="icon-folder-close"></i> Reserved Lists</a></li>
                                            <li><a href="<?=base_url()?>dashboard/list_users"><i class="icon-th-list"></i> Lists of Users</a></li>
                                        	<li><a href="<?=base_url()?>dashboard/accounts_analysis"><i class="icon-th"></i> General Reports</a></li>
                                        	<li><a href="<?=base_url()?>dashboard/account_summary"><i class="icon-list-alt"></i> Summary of New Accounts</a></li>
                                            <li><a href="<?=base_url()?>dashboard/about_us"><i class="icon-info-sign"></i> About the company</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="span10 rightWrapper">
                        	<h2><i class="icon-glass"></i> Restaurants</h2>
                        	<!--Body content-->
                            <ul class="nav nav-tabs">
                                <li>
                                	<a href="<?=base_url()?>dashboard/restaurants"><i class="icon-glass"></i> Lists</a>
                                </li>
								<?php
                                    $adminAuth = $this->session->userdata('intAccountType');
                                    if($adminAuth=='1')
                                    {
                                ?>
                                <li>
                                	<a href="<?=base_url()?>dashboard/add_owner"><i class="icon-plus-sign"></i> Add Owner</a>
                                </li>
                                <?php
                                    }
                                ?>
                                <li class="active">
                                	<a href="<?=base_url()?>dashboard/add_restaurant"><i class="icon-plus-sign"></i> Add Restaurant</a>
                                </li>
                            </ul>
                            <div class="contentHolder">
                            	<?php
									if($picMsg=='err_thumbnail')
									{
										echo '<div class="box error-box"> <span>Thumbnail must (189x86)pixel.</span></div>';
									}
									else if($picMsg=='err_banner')
									{
										echo '<div class="box error-box"> <span>Banner must (1098x469)pixel.</span></div>';
									}
									else if($intStatus=='1')
									{
										echo '<div class="box success-box"> <span>Restaurant was successfully created.</span></div>';
									}
									else if($intStatus=='0')
									{
										echo '<div class="box error-box"> <span>Restaurant was failed to create.</span></div>';
									}
									else
									{
										echo '';	
									}
								?>
                                <form action="<?=base_url()?>dashboard/add_restaurant" method="POST" enctype="multipart/form-data">
                                    <dl class="dl-horizontal dl-header">
                                        <dt style="width:180px"><h5><i class="icon-info-sign"></i> Restaurant Information</h5></dt>
                                    </dl>
                                    <dl class="dl-horizontal">
                                    	<?php
											if($adminAuth==1)
											{
										?>
                                        <dt>Restaurant Owner</dt>
                                        <dd>
                                            <select name="intRestoOwer" class="selectpicker" data-live-search="true" required="required">
                                           	<?php
												if($listRestoOwner!=0)
												{
													echo '<option value="">-- Select Owner --</option>';
													foreach($listRestoOwner as $key=>$val)
													{
														echo '<option value="'.$val['intUserID'].'">';
															if($val['strMiddleName']=='')
															{
																$midName = $val['strMiddleName'].' ';
															}
															else
															{
																$midName = '';	
															}
															echo $val['strFirstName'].' '.$midName.''.$val['strLastName'];
														echo '</option>';
													}
												}
											?>
                                            </select>
                                        </dd>
                                        <?php
											}
										?>
                                        <dt>Restaurant Name</dt>
                                        <dd><input type="text" name="strRestoName" required="required" value="<?=$this->input->post('strRestoName')?>" /></dd>
                                        <dt>Branch Name</dt>
                                        <dd><input type="text" name="strBranchName" required="required" value="<?=$this->input->post('strBranchName')?>" /></dd>
                                        <dt>Description</dt>
                                        <dd><textarea name="strRestoDescr" class="summernote"><?=$this->input->post('strRestoDescr')?></textarea></dd>
                                    </dl>
                                    <dl class="dl-horizontal dl-header">
                                        <dt><h5><i class="icon-picture"></i> Restaurant Assets</h5></dt>
                                    </dl>
                                    <dl class="dl-horizontal">
                                        <dt>Logo</dt>
                                        <dd style="margin-bottom:5px"><input type="file" name="strRestoThumbnail[]" accept="image/*" required="required" />
                                        <p>
                                        	<strong class="label label-info">(189x86)pixel</strong>
                                        </p>
                                        </dd>
                                        <dt>Banner</dt>
                                        <dd style="margin-bottom:5px"><input type="file" name="strRestoBanner[]" accept="image/*" required="required" />
                                        <p>
                                        	<strong class="label label-info">(1098x469)pixel</strong>
                                        </p>
                                        </dd>
                                        <dt>Random Screenshots</dt>
                                        <dd style="margin-bottom:5px">
                                            <input type="file" name="strRestoScreenShots[]" id="strRestoScreenShots" multiple="multiple" accept="image/*" required="required" />
                                        </dd>
                                    </dl>
                                    <dl class="dl-horizontal dl-header">
                                        <dt><h5><i class="icon-map-marker"></i> Restaurant Location</h5></dt>
                                    </dl>
                                    <dl class="dl-horizontal">
                                        <dt>Select Map Location</dt>
                                        <?php
                                            $getLatVal = 14.59207;
                                            $getLngVal = 121.059534;
                                        ?>
                                        <dd><a href="javascript:void(0)" class="btn btn-small btn-info" id="viewMap" data-lat="<?=$getLatVal?>" data-lng="<?=$getLngVal?>"><i class="icon-map-marker"></i> View Map</a>
                                        <input type="hidden" name="strLatLng" id="latlng" value="<?=$getLatVal.','.$getLngVal?>" /></dd><br />
                                        <dt>Address</dt>
                                        <dd><input type="text" name="strAddress" value="<?=$this->input->post('strAddress')?>" /></dd>
                                        <dt>City</dt>
                                        <dd><input type="text" name="strCity" value="<?=$this->input->post('strCity')?>" /></dd>
                                        <dt>Country</dt>
                                        <dd>
                                            <?=form_countries('country')?>
                                        </dd>
                                    </dl>
                                    <dl class="dl-horizontal dl-header">
                                        <dt><h5><i class="icon-tint"></i> Restaurant Contacts</h5></dt>
                                    </dl>
                                    <dl class="dl-horizontal">
                                        <dt>Mobile Phone</dt>
                                        <dd><input type="text" name="strMobile" id="strMobile" value="<?=$this->input->post('strMobile')?>" /></dd>
                                        <dt>Landline No.</dt>
                                        <dd><input type="text" name="strLandline" id="strLandline" value="<?=$this->input->post('strLandline')?>" /></dd>
                                        <dt>E-mail Address</dt>
                                        <dd><input type="text" name="strEmail" id="strEmail" required="required" value="<?=$this->input->post('strEmail')?>" /></dd>
                                    </dl>
                                    <dl class="dl-horizontal">
                                        <dd><button class="btn btn-primary" name="doAddResto" id="doAddResto" value="add_resto"><i class="icon-ok-sign"></i> Finish</button></dd>
                                    </dl>   
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
            <footer>

            </footer>
        </div>
